************FIGURE 2 **********
clear all
use Clean_data, clear

bys year: egen avg_z_total_points_F= mean(z_total_points) if female==1 & testNOQUOTA==1 & foreign==0
bys year: egen avg_z_total_points_M= mean(z_total_points) if female==0 & testNOQUOTA==1 & foreign==0

twoway 	(line inv_competNOQUOTA year if degree=="M" & year!=1987 & year!=1988 & female==0, ///
             lcolor(black) lpattern(solid)) ///
        (line avg_z_total_points_F year if degree=="M" & year!=1987 & year!=1988, ///
             lcolor(black) lpattern(longdash) yaxis(2)) ///
        (line avg_z_total_points_M year if degree=="M" & year!=1987 & year!=1988, ///
             lcolor(black) lpattern(shortdash) yaxis(2)), ///
        ylabel(, axis(1)) /// Eje principal
		 ytitle("Unconditional Probability of Getting a Position", axis(1)) /// Eje principal
		 ytitle("Total Score", axis(2)) /// Eje principal
        ylabel(, axis(2)) /// Eje secundario
        legend(order(1 "Unconditional Probability of Getting a Position" 2 "Women's total score" 3 "Men's total score") ///
               cols(3) ///
               position(6) ///
               region(margin(0 0 0 0)) ///
               size(small)) 
